<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html>
	<head>
		<title>调整申请计划</title>
		<script type="text/javascript">
			$(document).ready(function() {
				$("#planForm").validationEngine({
					promptPosition : "topLeft",
					ajaxFormValidation : true,
					onAjaxFormComplete : function(status, form, json, options) {
						if (json === 1) {
							art.dialog.tips("<label class='success'>修改成功！</label>",	1);
							$("button").attr("disabled", true);
							window.parent.location.reload();
						} else {
							art.dialog.tips("<label class='error'>修改失败，请刷新页面重试！</label>", 1);
						}
					}
				});
			});
		</script>
	</head>
	<body>
		<div class="container_16">
			<div class="grid_16">
				<div class="content_top">
					<span>调整申请计划</span>
				</div>
				<div class="content_bottom">
					<form id="planForm" action="${ctx}/savePlan.html" method="post">
						<input type="hidden" name="vipServiceId" value="${vipServiceId }" />
						<table cellpadding="0" cellspacing="0" style="margin-left: 35px; width: 450px;">
							<s:iterator value="planList" status="st">
								<tr>
									<td>
										<label><s:property value="name" /></label>
										<input type="hidden" name="planList[<s:property value="#st.index"/>].name" value="<s:property value="name"/>">
										<input type="hidden" name="planList[<s:property value="#st.index"/>].type" value="<s:property value="type"/>">
									</td>
									<td>
										<input type="text" id="info<s:property value="#st.index"/>" name="planList[<s:property value="#st.index"/>].endTime" value="<s:date name="endTime" format="yyyy-MM-dd"/>" class="validate[required,custom[date]] input">
										<script>
											datePickerController .createDatePicker({
												formElements : {
													"info<s:property value="#st.index"/>" : "%Y-%m-%d"
												}
											});
										</script>
									</td>
									<td>
										<s:select name="planList[%{#st.index}].status" list="#{'0':'未开始','1':'进行中','2':'已完成'}" value="status" cssClass="input_100" />
									</td>
								</tr>
							</s:iterator>
							<tr>
								<td>
									&nbsp;
								</td>
								<td colspan="2">
									<label class="btn">
										<input type="submit" value="提交" />
									</label>
								</td>
							</tr>
						</table>
					</form>
				</div>
			</div>
		</div>
	</body>
</html>